home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip
/
MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf
/
Programming
/
Basic_Tutorial_8
/
NewpicShow.bas
< prev
next >
Wrap
BASIC Source File
|
1992-03-30
|
2KB
|
115 lines
LIBRARY "arp.library"
DECLARE FUNCTION FileRequest& LIBRARY
DECLARE FUNCTION xOpen& LIBRARY
DECLARE FUNCTION Execute& LIBRARY
DIM req&(7)
MENU 2,0,0,""
MENU 3,0,0,""
MENU 4,0,0,""
MENU 1,0,1,"Program"
MENU 1,1,1,"New-Cli "
MENU 1,2,1,"Show Picture "
MENU 1,3,1,"Quit "
Init:
SCREEN 1,640,256,3,2
WINDOW 2,,,0,1
FOR q = 0 TO 7
READ r,g,b
PALETTE q,r/16,g/16,b/16
NEXT q
RESTORE
DATA 0,0,0, 0,0,15, 15,0,0, 0,15,0, 14,7,0, 0,4,10, 8,0,15, 7,7,7
Start:
LOCATE 15,15
PRINT "Press Right Mouse Button for Menus"
ON MENU GOSUB MSel
MENU ON
MainLoop:
WHILE -1
WEND
GOTO Endit
MSel:
Men=MENU(0)
Sel=MENU(1)
ON Men GOTO Prog
Prog:
ON Sel GOTO Bascli,Direct,Endit
Bascli:
PRINT CHR$(12)
PRINT:PRINT
PRINT "PLEASE ENTER THE PATH TO THE PROGRAM YOU WISH TO RUN"
INPUT "1>";comm$
OUT$="RAM:CLI_out"+CHR$(0)
comm$=comm$+CHR$(0)
connect&=xOpen&(SADD(OUT$),1006)
ex&=Execute&(SADD(comm$),0,connect&)
xClose(connect&)
bline=1
PRINT CHR$(12)
OPEN "I",#1,"RAM:CLI_out"
WHILE NOT EOF(1)
LINE INPUT #1,inf$
PRINT inf$
bline=bline+1
IF CSRLIN=24 THEN
INPUT "Press any key to continue",dum$
PRINT CHR$(12)
END IF
WEND
CLOSE #1
INPUT "Press any key to continue ",dum$
PRINT CHR$(12)
GOTO Start
Direct:
title$="Show a picture file"
dir$="Megadisc27A:Art_Gallery" '""=current directory, or you may specify one
file$="" 'this could be set to a default value if you like
dloop:
requester title$,dir$,file$,colr
IF file$="" THEN
PRINT "No file selected!":GOTO Start
ELSE
IF RIGHT$(dir$,1)<>":" AND dir$>"" THEN dir$=dir$+ "/"
comm$="SYS:c/FullView "+dir$+file$+" +p"
END IF
OUT$="RAM:CLI_out"+CHR$(0)
comm$=comm$+CHR$(0)
connect&=xOpen&(SADD(OUT$),1006)
ex&=Execute&(SADD(comm$),0,connect&)
xClose(connect&)
dir$="DH0:pics":file$=""
GOTO dloop
Endit:
LIBRARY CLOSE
WINDOW CLOSE 2
SCREEN CLOSE 1
SYSTEM
SUB requester(title$,dir$,file$,colr) STATIC
SHARED req&()
title$=title$+CHR$(0)
dir$=dir$+STRING$(354,0)
file$=file$+STRING$(32,0)
req&(0)=SADD(title$)
req&(1)=SADD(file$)
req&(2)=SADD(dir$)
req&(3)=WINDOW(7)
req&(4)=2^28-2^29*(colr=1)
temp&=FileRequest&(VARPTR(req&(0)))
IF temp&=0 THEN file$=CHR$(0)
dir$=LEFT$(dir$,INSTR(dir$,CHR$(0))-1)
file$=LEFT$(file$,INSTR(file$,CHR$(0))-1)
END SUB